package br.edu.ufcg.embedded.eolica.view;

import javax.microedition.lcdui.Alert;
import javax.microedition.lcdui.Command;
import javax.microedition.lcdui.CommandListener;
import javax.microedition.lcdui.Displayable;

import br.edu.ufcg.embedded.eolica.MIDlet.UsinaEolicaMIDlet;
import br.edu.ufcg.embedded.eolica.util.MyCallback;
import br.edu.ufcg.embedded.eolica.util.Properties;

public class QuestionAlert extends Alert {

	public static String YES;
	public static String NO;
	protected Command cmdYes;
	protected Command cmdNo;
	private MyCallback callback;
	private Properties prop;
	
	public QuestionAlert(String title, String message, CommandListener callback) {
		super(title);
		setString(message);
		//setTimeout(Alert.);
		
		prop = UsinaEolicaMIDlet.getProp();		
		YES = prop.getProperty("label.yes");
		NO = prop.getProperty("label.no");
		
		cmdYes = new Command(YES, Command.OK, 0);
		cmdNo = new Command(NO, Command.CANCEL, 0);
		
		addCommand(cmdYes);
		addCommand(cmdNo);
		setCommandListener(callback);
		
	}	
}
